<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.ultraq.net.nz/web/thymeleaf/layout ">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>管理员信息</title>
  <link rel="stylesheet"
        th:href="@{https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback}"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome -->
  <link rel="stylesheet" th:href="@{/plugins/fontawesome-free/css/all.min.css}"
        href="../../static/plugins/fontawesome-free/css/all.min.css">
  <!-- DataTables -->
  <link rel="stylesheet" th:href="@{/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css}"
        href="../../static/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" th:href="@{/plugins/datatables-responsive/css/responsive.bootstrap4.min.css}"
        href="../../static/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
  <link rel="stylesheet" th:href="@{/plugins/datatables-buttons/css/buttons.bootstrap4.min.css}"
        href="../../static/plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
  <link rel="stylesheet" th:href="@{/plugins/datatables-select/css/select.bootstrap4.min.css}"
        href="../../static/plugins/datatables-select/css/select.bootstrap4.min.css">
  <link rel="stylesheet" th:href="@{/plugins/icheck-bootstrap/icheck-bootstrap.min.css}"
        href="../../static/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <link rel="stylesheet" th:href="@{/plugins/toastr/toastr.min.css}"
        href="../../static/plugins/toastr/toastr.min.css">
  <link rel="stylesheet" th:href="@{/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css}"
        href="../../static/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" th:href="@{/dist/css/adminlte.min.css}"
        href="../../static/dist/css/adminlte.min.css">
  <link rel="stylesheet"
        th:href="@{https://cdn.bootcdn.net/ajax/libs/bootstrap-switch/4.0.0-alpha.1/css/bootstrap-switch.min.css}"
        href="https://cdn.bootcdn.net/ajax/libs/bootstrap-switch/4.0.0-alpha.1/css/bootstrap-switch.min.css">
</head>
<body class="wrapper">
<input type="hidden" th:value="${msg}" id="msg">
<section class="content">
  <div class="container-fluid mt-2">
    <div class="row">
      <div class="col-3">
        <div class="card">
          <div class="card-header">
            <h3 class="card-title">
              <i class="fas fa-map-pin"></i>
              选择区域
            </h3>
          </div>
          <!-- /.card-header -->
          <div class="card-body p-0 table-responsive" style="height: 600px;">
            <table class="table table-sm">
              <thead>
              <tr>
                <th>地区名称</th>
                <th>添加</th>
              </tr>
              </thead>
              <tbody th:each="area:${areas}">
              <tr data-widget="expandable-table" aria-expanded="false" th:if="${area.parent eq 0}">
                <td>
                  <i class="expandable-table-caret fas fa-caret-right fa-fw"></i>
                  <span th:text="${area.name}" th:onclick="showRefresh([[${area.id}]])">厦门</span>
                </td>
                <td>
                  <div>
                    <button onclick="showEdit();stopBubble();" class="btn btn-outline-success btn-sm"><i
                            class="fa-plus fas"></i>
                    </button>
                  </div>
                </td>
              </tr>
              <tr th:if="${area.parent ne 0}" class="expandable-body">
                <td colspan="2">
                  <div class="p-0">
                    <table class="table table-sm">
                      <tbody>
                      <tr>
                        <td>
                          <div class="ml-4" th:text="${area.name}" th:onclick="showRefresh([[${area.id}]])">
                            集美
                          </div>
                        </td>
                        <td>
                          <div class="text-center">
                            <button onclick="showEdit()" class="btn btn-outline-success btn-sm"><i
                                    class="fa-plus fas"></i></button>
                          </div>
                        </td>
                      </tr>
                      </tbody>
                    </table>
                  </div>
                </td>
              </tr>
              </tbody>
            </table>
          </div>
          <!-- /.card-body -->
        </div>
      </div>
      <div class="col-9">
        <form id="listForm" th:action="@{/base/admins/deleteAdmins}">
          <div class="card">
            <div class="card-body p-0 table-responsive" style="height: 590px;">
              <table id="table" th:fragment="showRefresh" class="table table-hover table-sm">
                <thead>
                <tr>
                  <th>
                    <div class="icheck-primary">
                      <input type="checkbox" id="checkall">
                      <label for="checkall"></label>
                    </div>
                  </th>
                  <th class="text-center">登录账户</th>
                  <th class="text-center">区域</th>
                  <th class="text-center">姓名</th>
                  <th class="text-center">角色</th>
                  <th class="text-center">启用</th>
                  <th class="text-center">手机</th>
                  <th class="text-center">邮箱</th>
                  <th class="text-center">创建时间</th>
                  <th class="text-center">编辑</th>
                  <th class="text-center">删除</th>
                </tr>
                </thead>
                <tbody th:if="${admins ne 'null'}">
                <tr th:each="admin:${admins}">
                  <td>
                    <div class="icheck-primary">
                      <input name="idList" th:value="${admin.id}" type="checkbox" th:id="${admin.name}+${admin.id}">
                      <label th:for="${admin.name}+${admin.id}"></label>
                    </div>
                  </td>
                  <td class="text-center" th:text="${admin.username}"></td>
                  <div th:each="area:${areas}">
                    <td class="text-center" th:text="${area.name}" th:if="${admin.areaId}==${area.id}"></td>
                  </div>
                  <td class="text-center" th:text="${admin.name}"></td>
                  <td class="text-center" th:text="${admin.role}"></td>
                  <td class="text-center" th:text="${admin.enable eq 1 ? '√':'×'}"></td>
                  <td class="text-center" th:text="${admin.phone}"></td>
                  <td class="text-center" th:text="${admin.email}"></td>
                  <td class="text-center" th:text="${admin.createTime}">2021.1.5</td>
                  <td>
                    <a type="button" class="btn btn-block btn-outline-primary btn-sm"
                       data-toggle="modal" data-target="#edit1"
                       th:onclick="edit_customer([[${admin.id}]],[[${admin.areaId}]],[[${admin.username}]],[[${admin.password}]],[[${admin.name}]],[[${admin.phone}]],[[${admin.email}]],[[${admin.remark}]])">
                      <i class="fas fa-edit"></i>
                    </a>
                  </td>
                  <td>
                    <a onclick="return confirm('确认删除吗？')" th:href="@{/base/admins/delete?(id=${admin.id})}"
                       type="button" class="btn btn-block btn-outline-danger btn-sm">
                      <i class="fas fa-times"></i>
                    </a>
                  </td>
                </tr>
                </tbody>
              </table>
            </div>
            <!-- /.card-body -->
          </div>

        </form>
        <!-- /.card -->
      </div>

    </div>
  </div>
</section>

<!--添加信息的弹出层-->
<div id="edit" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header bg-primary">
        <!--                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>-->
        <h5 class="modal-title">
          <i class="fas fa-edit"></i>
          <span id="lblAddTitle">添加管理员</span>
        </h5>
      </div>
      <form class="form-horizontal form-bordered form-row-stripe" id="ffAdd" th:action="@{/base/admins/addAdmin}"
            method="post" data-toggle="validator"
            enctype="multipart/form-data">
        <div class="modal-body">
          <div class="row">
            <div class="col-md-12">
              <div class="form-group">
                <label>所属区域</label>
                <div class="col-md-10">
                  <select class="custom-select" id="AreaId" name="AreaId">
                    <option class="text-center" th:selected="${area.id eq AreaId}" th:each="area:${areas}" th:text="${area.name}" th:value="${area.id}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">登录账户</label>
                <div class="col-md-10">
                  <input id="Username" name="Username" type="text" class="form-control" placeholder="登录账户..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">登录密码</label>
                <div class="col-md-10">
                  <input id="Password" name="Password" type="password" class="form-control"
                         placeholder="登录密码..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">姓名</label>
                <div class="col-md-10">
                  <input id="Name" name="Name" class="form-control" placeholder="姓名..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">角色</label>
                <div class="col-md-10">
                  <input id="Role" name="Name" class="form-control" placeholder="角色..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">是否启用</label>
                <div class="col-md-4">
                  <div class="switch" id="mySwitch">
                    <input id="Enable" value="1" name="Enable" type="checkbox" checked/>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">手机</label>
                <div class="col-md-10">
                  <input id="Phone" name="Phone" class="form-control" placeholder="手机..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">邮箱</label>
                <div class="col-md-10">
                  <input id="Email" name="Email" class="form-control" placeholder="邮箱..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">备注信息</label>
                <div class="col-md-10">
                  <textarea id="Remark" name="Remark" class="form-control" placeholder="备注信息..."></textarea>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="submit" class="btn btn-outline-primary">确定</button>
          <button type="button" class="btn btn-outline-danger" data-dismiss="modal">取消</button>
        </div>
      </form>
    </div>
  </div>
</div>
<!--编辑信息的弹出层-->
<div id="edit1" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header bg-primary">
        <!--                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>-->
        <h5 class="modal-title">
          <i class="fas fa-edit"></i>
          <span id="lblAddTitle1">编辑管理员</span>
        </h5>
      </div>
      <form class="form-horizontal form-bordered form-row-stripe" id="ffEdit" th:action="@{/base/admins/update}"
            method="post" data-toggle="validator"
            enctype="multipart/form-data">
        <div class="modal-body">
          <div class="row">
            <div class="col-md-12">
              <div class="form-group">
                <label>所属区域</label>
                <div class="col-md-10">
                  <select id="AreaId1" name="AreaId" class="custom-select">
                    <option class="text-center" th:selected="${area.id eq AreaId}" th:each="area:${areas}" th:text="${area.name}" th:value="${area.id}"></option>
                  </select>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">登录账户</label>
                <div class="col-md-10">
                  <input id="Username1" name="Username" type="text" class="form-control" placeholder="登录账户..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">登录密码</label>
                <div class="col-md-10">
                  <input id="Password1" name="Password" type="password" class="form-control"
                         placeholder="登录密码..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">姓名</label>
                <div class="col-md-10">
                  <input id="Name1" name="Name" class="form-control" placeholder="姓名..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">角色</label>
                <div class="col-md-10">
                  <input id="Role1" name="Role" class="form-control" placeholder="角色..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">是否启用</label>
                <div class="col-md-4">
                  <div class="switch" id="mySwitch1">
                    <input id="Enable1" value="1" name="Enable" type="checkbox" checked/>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">手机</label>
                <div class="col-md-10">
                  <input id="Phone1" name="Phone" class="form-control" placeholder="手机..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">邮箱</label>
                <div class="col-md-10">
                  <input id="Email1" name="Email" class="form-control" placeholder="邮箱..."/>
                </div>
              </div>
            </div>
            <div class="col-md-12">
              <div class="form-group">
                <label class="control-label col-md-4">备注信息</label>
                <div class="col-md-10">
                  <textarea id="Remark1" name="Remark" class="form-control" placeholder="备注信息..."></textarea>
                </div>
              </div>
            </div>
            <div>
              <input id="Tid1" name="id" type="text" class="form-control" style="display: none"/>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="submit" class="btn btn-outline-primary">确定</button>
          <button type="button" class="btn btn-outline-danger" data-dismiss="modal">取消</button>
        </div>
      </form>
    </div>
  </div>
</div>
<!--删除操作的确认弹窗-->
<div id="delete" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header bg-warning">
        <!--                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>-->
        <h5 class="modal-title">
          <i class="fas fa-exclamation-circle"></i>
          <span id="lblDeleteTitle">操作提醒</span>
        </h5>
      </div>
      <form class="form-horizontal form-bordered form-row-stripe" id="ffDelete" action="" data-toggle="validator"
            enctype="multipart/form-data">
        <div class="modal-body">
          <div class="row">

            <div class="col-md-12">
              <div class="form-group text-center">
                <i class="fa fa-exclamation-circle fa-5x" style="color: #ff3200"></i><br><br>
                <h4><strong>您确认删除选定的内容吗</strong></h4>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="submit" class="btn">取消</button>
          <button type="button" class="btn btn-outline-danger" data-dismiss="modal">确认删除</button>
        </div>
      </form>
    </div>
  </div>
</div>

<!-- jQuery -->
<script th:src="@{/plugins/jquery/jquery.min.js}"
        src="../../static/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script th:src="@{/plugins/bootstrap/js/bootstrap.bundle.min.js}"
        src="../../static/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- DataTables  & Plugins -->
<script th:src="@{/plugins/datatables/jquery.dataTables.min.js}"
        src="../../static/plugins/datatables/jquery.dataTables.min.js"></script>
<script th:src="@{/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js}"
        src="../../static/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script th:src="@{/plugins/datatables-responsive/js/dataTables.responsive.min.js}"
        src="../../static/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script th:src="@{/plugins/datatables-responsive/js/responsive.bootstrap4.min.js}"
        src="../../static/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script th:src="@{/plugins/datatables-buttons/js/dataTables.buttons.min.js}"
        src="../../static/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script th:src="@{/plugins/datatables-buttons/js/buttons.bootstrap4.min.js}"
        src="../../static/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script th:src="@{/plugins/datatables-select/js/select.bootstrap4.min.js}"
        src="../../static/plugins/datatables-select/js/select.bootstrap4.min.js"></script>
<script th:src="@{/plugins/jszip/jszip.min.js}"
        src="../../static/plugins/jszip/jszip.min.js"></script>
<script th:src="@{/plugins/pdfmake/pdfmake.min.js}"
        src="../../static/plugins/pdfmake/pdfmake.min.js"></script>
<script th:src="@{/plugins/pdfmake/vfs_fonts.js}"
        src="../../static/plugins/pdfmake/vfs_fonts.js"></script>
<script th:src="@{/plugins/datatables-buttons/js/buttons.html5.min.js}"
        src="../../static/plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script th:src="@{/plugins/datatables-buttons/js/buttons.print.min.js}"
        src="../../static/plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script th:src="@{/plugins/datatables-buttons/js/buttons.colVis.min.js}"
        src="../../static/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
<script th:src="@{/plugins/datatables-select/js/dataTables.select.min.js}"
        src="../../static/plugins/datatables-select/js/dataTables.select.min.js"></script>
<script th:src="@{/plugins/toastr/toastr.min.js}"
        src="../../static/plugins/toastr/toastr.min.js"></script>
<script th:src="@{/plugins/sweetalert2/sweetalert2.min.js}"
        src="../../static/plugins/sweetalert2/sweetalert2.min.js"></script>
<script th:src="@{/plugins/jquery-validation/jquery.validate.min.js}"
        src="../../static/plugins/jquery-validation/jquery.validate.min.js"></script>
<script th:src="@{/plugins/jquery-validation/additional-methods.min.js}"
        src="../../static/plugins/jquery-validation/additional-methods.min.js"></script>
<script th:src="@{/plugins/jquery-validation/localization/messages_zh.min.js}"
        src="../../static/plugins/jquery-validation/localization/messages_zh.min.js"></script>
<!-- AdminLTE App -->
<script th:src="@{/dist/js/adminlte.min.js}"
        src="../../static/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/dist/js/demo.js}"
        src="../../static/dist/js/demo.js"></script>

<script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-switch/4.0.0-alpha.1/js/bootstrap-switch.min.js"
        th:src="@{https://cdn.bootcdn.net/ajax/libs/bootstrap-switch/4.0.0-alpha.1/js/bootstrap-switch.min.js}"></script>
<script>
  $(function () {
    $('#table').DataTable({
      'responsive': true,
      'lengthChange': false,
      'autoWidth': false,
      'iDisplayLength': 10, //默认10行
      'sPaginationType': 'full_numbers', //分页样式
      "language": {
        "sSearch": "搜索管理员:",
        "sProcessing": "正在加载中......",
        "sLengthMenu": "每页显示 _MENU_ 条记录",
        "sZeroRecords": "对不起，查询不到相关数据！",
        "sEmptyTable": "表中无数据存在！",
        "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",
        "oPaginate": {
          "sFirst": "首页",
          "sPrevious": "上一页",
          "sNext": "下一页",
          "sLast": "末页"
        }
      },
      'ordering': false,
      'buttons': [
        {
          extend: 'excel',
          text: '<i class="fa fa-download" aria-hidden="true"> 导出 Excel</i>',
          className: 'btn btn-success btn-sm'
        }, {
          extend: 'print',
          text: '<i class="fa fa-print" aria-hidden="true"> 打印</i>',
          className: 'btn btn-default btn-sm'
        }, {
          extend: '',
          text: '<i class="fa fa-plus-square" aria-hidden="true"> 添加</i>',
          className: 'btn btn-info btn-sm',
          action: function () {
            showEdit();
          }
        }, {
          extend: '',
          text: '<i class="fa fa-trash" aria-hidden="true"> 删除选中行</i>',
          className: 'btn btn-danger btn-sm',
          action: function () {
            // $('#delete').modal('show');
            deleteAdmins();
          }
        }
      ]
    }).buttons().container().appendTo('#table_wrapper .col-md-6:eq(0)')

    //批量选中
    var checkall = $("#checkall");
    var items = $("input[name='idList']");
    checkall.click(function () {
      if ($(this).prop("checked")) {
        items.each(function () {
          $(this).prop('checked', true);
        })
      } else {
        items.each(function () {
          $(this).prop('checked', false);
        })
      }
      items.click(function () {
        checkall.prop("checked", items.length == $("input[name='idList']:checked").length ? true : false);
      })
    });

    //弹窗checkbox样式
    $('#mySwitch input').bootstrapSwitch({
      onText: 'On',
      offText: 'Off'
    });
    $('#mySwitch1 input').bootstrapSwitch({
      onText: 'On',
      offText: 'Off'
    });
    //操作结果提示
    var msg = $("#msg").val();
    var Toast = Swal.mixin({
      toast: true,
      position: 'top-end',
      showConfirmButton: false,
      timer: 3000
    });
    if (msg) {
      if (!msg.endsWith("成功！")) {
        toastr.error(msg)
      } else {
        toastr.success(msg)
      }
    }
  })
  $('#ffAdd').validate({
    rules: {
      Username: {
        required: true,
        minlength: 3,
        maxlength: 20,
      },
      Password: {
        required: true,
        minlength: 6,
        maxlength: 20
      },
      Name: {
        required: true,
        minlength: 2,
        maxlength: 20
      },
      Phone: {
        required: true,
        rangelength: [7, 11],
        digits: true
      },
      Email: {
        required: true,
        email: true
      },
    },

    errorElement: 'span',
    errorPlacement: function (error, element) {
      error.addClass('invalid-feedback');
      element.closest('.form-group').append(error);
    },
    highlight: function (element, errorClass, validClass) {
      $(element).addClass('is-invalid');
    },
    unhighlight: function (element, errorClass, validClass) {
      $(element).removeClass('is-invalid');
    }
  });
  $('#ffEdit').validate({
    rules: {
      Username: {
        required: true,
        minlength: 3,
        maxlength: 20,
      },
      Password: {
        required: true,
        minlength: 6,
        maxlength: 20
      },
      Name: {
        required: true,
        minlength: 2,
        maxlength: 20
      },
      Phone: {
        required: true,
        rangelength: [7, 11],
        digits: true
      },
      Email: {
        required: true,
        email: true
      },
    },

    errorElement: 'span',
    errorPlacement: function (error, element) {
      error.addClass('invalid-feedback');
      element.closest('.form-group').append(error);
    },
    highlight: function (element, errorClass, validClass) {
      $(element).addClass('is-invalid');
    },
    unhighlight: function (element, errorClass, validClass) {
      $(element).removeClass('is-invalid');
    }
  });


  //显示模态框
  function showEdit() {
    $('#edit').modal('show');
  }

  function showEdit1() {
    $('#edit1').modal('show');
  }

  function stopBubble(e) {
    if (e && e.stopPropagation) {
      e.stopPropagation();
    } else {
      window.event.cancelBubble = true;
    }
  }

  function deleteAdmins() {
    if (!confirm('确认删除选中行吗？'))
      return false;
    $("#listForm").submit();
  }

  function edit_customer(t_id, t_areaId, t_username, t_password, t_name, t_phone, t_email, t_remark) {
    $("#Tid1").val(t_id);
    $("#AreaId1").val(t_areaId);
    $("#Username1").val(t_username);
    $("#Password1").val(t_password);
    $("#Name1").val(t_name);
    $("#Phone1").val(t_phone);
    $("#Email1").val(t_email);
    $("#Remark1").val(t_remark);
  }
  var data = {
    "ParentId":0
  }
  function showRefresh(ParentId){
    data["ParentId"] = ParentId;
    $("#table").load("/base/admins/showRefresh",data);
  }
</script>
</body>
</html>
